package info.unlp.tesis.transformation.plugin.wizard;

import info.unlp.tesis.transformation.plugin.atl.ATLTransformationAction;

import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;

public class GenerateATLPage extends WizardPage {

	public GenerateATLPage(String pageName){
		super(pageName);
		setTitle("Obteniendo la transformacion.");
		setDescription("Presione <<Generar ATL>>.");
	}
	
	
	@Override
	public void createControl(Composite parent) {
		Composite container = new Composite(parent, SWT.NULL);
		GridLayout layout = new GridLayout();
		container.setLayout(layout);
		layout.numColumns = 1;
		layout.verticalSpacing = 9;

		Button generateATLButton = new Button(container, SWT.PUSH);
		generateATLButton.setText("Generar ATL");
		generateATLButton.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				handleGenerateATL();
			}
		});

		setControl(container);

	}
	
	private void handleGenerateATL() {
		new ATLTransformationAction();
		
	}


}
